package hu.uniobuda.nik.openday.maps;

import android.graphics.Canvas;
import android.graphics.drawable.Drawable;

import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.MapView;
import com.google.android.maps.OverlayItem;

public class PositionOverlays extends ItemizedOverlay<OverlayItem> {

	private OverlayItem position;
	
	public PositionOverlays(Drawable drawable) {
		super(boundCenterBottom(drawable));
		populate();
	}
	
	public void setPosition(OverlayItem position) {
		this.position = position;
		populate();
	}
	
	public OverlayItem getPosition() {
		return position;
	}

	@Override
	protected OverlayItem createItem(int i) {
		return position;
	}

	@Override
	public int size() {
		return position == null ? 0 : 1;
	}
	
	@Override
	public void draw(Canvas canvas, MapView mapView, boolean shadow) {
		super.draw(canvas, mapView, false);
	}

}
